#lang rosetta-racket


(provide shape-cloud)


(define (random-spherical-bound d1 d2 sr shape-fn)
  (let* ((r (random-interval d1 d2))
         (th (random-interval 0 (* pi 2)))
         (fi (random-interval 0 pi))
         (p (sph r th fi)))
    (move p (shape-fn (- sr r) p))))

(define (shape-cloud d1 d2 r n shape-fn)
  (for/list ((i (: n)))
    (random-spherical-bound d1 d2 r shape-fn)))